import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Index from '../pages/index/Index'
import Main from '../pages/index/sub/Main'
import Test from '../pages/index/sub/Test'

Vue.use(Router)

export default createRooter => {

  return new Router({
    routes: [
      /*{
        path: '/',
        name: 'HelloWorld',
        component: HelloWorld
      }*/
      {
        path: '/',

        name: 'Index',
        component: Index,
        children: [
          {
            alias: '/',
            path: '/index',
            name: '/IndexSub',
            component: Main
          },
          {
            path: '/test',
            name: '/Test',
            component: Test
          }
        ]
      }
    ]
  })

}
